<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .wbox{
            width: 1000px;
            height: 400px;
            margin: auto;
            display: flex;
            align-items: center;
            background-color: antiquewhite;
            border: 2px solid brown;
            box-shadow: 50px 50px 10px gray;
        }
        .lbox{
            width: 500px;
            margin: auto;
            display: flex;
            flex-direction: column; /* 改变主轴方向 */
        }
        .ts{
            font-size: 18px;
        }
        .ws1{
            font-size: 30px;
        }
        .ws2{
            font-size: 24px;
        }
        span{
            margin: 10px 0;
            font-weight: 700;
        }
        .win{
            color: brown;
        }
    </style>
</head>
<body>
    <div class="wbox">
        <div class="lbox">
            <span class="ts">传智教育年会抽奖</span>
            <span class="ws1">一等奖:<span class="win"></span></span>
            <span class="ws2">二等奖:</span>
            <span class="ws3">三等奖:</span>
        </div>
    </div>
    <script>
        const personArr= ['周杰伦', '刘德华', '周星驰', '范老师', '张学友']
        const sp1=document.querySelector('.ws1')
        const sp2=document.querySelector('.ws2')
        const sp3=document.querySelector('.ws3')
        //一等奖:
        let i=Math.floor(Math.random()*personArr.length)
        sp1.innerHTML=`<span>一等奖:<span class="win">${personArr[i]}</span></span>`
        personArr.splice(i,1)
        //二等奖:
        let n=Math.floor(Math.random()*personArr.length)
        sp2.innerHTML=`<span>二等奖:${personArr[n]}</span>`
        personArr.splice(n,1)
        //三等奖:
        let v=Math.floor(Math.random()*personArr.length)
        sp3.innerHTML=`<span>三等奖:${personArr[v]}</span>`
    </script>
</body>
</html>